// components/shoplistcom/shoplistcom.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    idshop:Number,
    cangbool:Boolean,
    title: String,
    imgs:String,
    num: Number,
    longitude:Number,
    latitude:Number,
    dataall:Object
   
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    phonefun(e) {
      console.log(e.currentTarget.dataset.num);
      wx.makePhoneCall({
        phoneNumber: e.currentTarget.dataset.num
      })
    },
    mapfun(e){
      console.log(e.currentTarget.dataset);
      let {latitude,longitude} = e.currentTarget.dataset
      wx.openLocation({
        latitude: latitude,
        longitude: longitude,
      })
    },
    shoucangfun(e){
      // console.log(e.currentTarget.dataset);
      let {id,cangbool,dataall}=e.currentTarget.dataset
      console.log(id);
      console.log(cangbool);
      wx.request({
        url: ' http://localhost:8866/shoplist/'+id,
        method:"PUT",
        data:{...dataall,cang:!cangbool},
        success:(ok)=>{
          console.log(ok);
          this.triggerEvent("zicangFun","")
        }
      })
  
    }
  }
})